package com.qibao.springboot.controller;

import com.qibao.springboot.service.IHelloService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
//@Api
//@RequestMapping
public class HelloController {
    @Autowired
    private IHelloService helloService;

    @RequestMapping(value = "/")
    public String sayHello(HttpServletRequest request, HttpServletResponse response) {
        String name   = request.getParameter("name");
        String result = "";
        if (name != null && !name.equals("")) {
            result = helloService.sayHello(name);
        } else {
            result = "内容不存在啊";
        }
        return result;

    }
}
